package com.sendi.system.bean;

import java.util.HashMap;
import java.util.List;

import com.sendi.system.entity.SysBeanMap;
import com.sendi.system.service.ServiceSupportImp;

/*
 * 需要进行日志记录的bean缓存
 */
public class SysLogbean {
	public ServiceSupportImp serviceSupportImp; 
	private  HashMap<String,String> beanmap=new HashMap<String, String>();
	public void initBeanMap()
	{
		 String hql="from SysBeanMap where islog='on'";
		 List datas=serviceSupportImp.findByHQL(hql);
		 for(Object o:datas)
		 {
			 SysBeanMap slb=(SysBeanMap)o;
			 beanmap.put(slb.getBeanName(), slb.getBeamBsname());
		 }
	}
  
	public boolean isNeedlog(String beanname)
	{
		if(this.beanmap.get(beanname)==null)
		{
			return false;
		}
		return true;
	}
	public String getBeanBsName(String beanname)
	{
		if(isNeedlog(beanname))
		{
			return this.beanmap.get(beanname);
		}
		
		return "";
	}
	public HashMap<String, String> getBeanmap() {
		return beanmap;
	}
	public void setBeanmap(HashMap<String, String> beanmap) {
		this.beanmap = beanmap;
	}

	public ServiceSupportImp getServiceSupportImp() {
		return serviceSupportImp;
	}

	public void setServiceSupportImp(ServiceSupportImp serviceSupportImp) {
		this.serviceSupportImp = serviceSupportImp;
	}
	

}
